]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Scripting: exit if the perf script throws an error during collection
authorOwen W. Taylor <otaylor@fishsoup.net>
Tue, 20 May 2014 01:34:04 +0000 (21:34 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Sun, 29 Jun 2014 22:27:54 +0000 (18:27 -0400)
If an exception occurs while collecting parameters, exit rather than
just leaving the shell running in the main loop.

https://bugzilla.gnome.org/show_bug.cgi?id=732349

js/ui/scripting.js

index 1da99d9775182de6e744d3e02f244cfb86da6043..72f670261fcd3a952afa97785504a0ebb8b7c82f 100644 (file)
@@ -360,7 +360,12 @@ function runPerfScript(scriptModule, outputFile) {
 
     _step(g,
           function() {
-              _collect(scriptModule, outputFile);
+              try {
+                  _collect(scriptModule, outputFile);
+              } catch (err) {
+                  log("Script failed: " + err + "\n" + err.stack);
+                  Meta.exit(Meta.ExitCode.ERROR);
+              }
               Meta.exit(Meta.ExitCode.SUCCESS);
           },
          function(err) {